package com.broadsword.controller;


import com.broadsword.publishers.MyApplicationPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class MessagePublish {

    @Autowired
    private MyApplicationPublisher publisher;

    @GetMapping("/send/{message}")
    public void send(@PathVariable String message) {
        publisher.publishEvent(message);
    }



}
